<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 箭头函数
        let fn = (a, b) => a + b;
        fn(11, 22)
        //箭头函数不能使用arguments，可以用reset参数
        let fn2 = (...x) => {
            console.log(x);
        }
        fn2(2, 4, 5, 6)
        //箭头函数不能使用this this指向父作用域
        //this指向定义时所在对象【不会变】
        let obj = {
            say: () => {
                console.log(this);
            }
        }
        obj.say() //-->obj
        var xx = obj.say;
        xx(); // -->window
    </script>
</body>

</html>